package Second;
//创建类
class Circle {
    private int r;
    private float S;
    private float C;
    private static final float PI = 3.1415926f;

    // 构造函数
    public Circle(int r) {
        this.r = r;
        this.S = PI * r * r;
        this.C = 2 * PI * r;
    }

    // 获取类的变量值
    public int getR() {
        return r;
    }

    public float getS() {
        return S;
    }

    public float getC() {
        return C;
    }

    // 输出格式
    public String toString() {
        return "半径: " + r + ", 面积: " + S + ", 周长: " + C;
    }

    public static void main(String[] args) {
        // 创建对象并输出圆的信息
        Circle circle1 = new Circle(3);
        System.out.println("圆的信息：");
        System.out.println(circle1.toString());
    }
}
